added takeSnapshot