Fixed code that creates snapshots to keep track of when the last snapshot was taken, so it does not use 100% of the CPU and constantly write snapshots