add takesnapshot support