Handling sigint correctly