added stopCapture to snap function