added code to stop recording -if recording- on Ctrl-c