Handle ctrl-c in main