fix takesnapshot