Added code take snapshot