Creating a function to automatically remediate snapshots