fix js bug re: grabbing snapshot