Added code to check if there is already a snapshot