modify takeSnapshot method