Caught KeyboardInterrupt and handle exit gracefully