update the snapshot function