gracefully handle KeyboardInterrupt (Ctrl+C)