Fixed the sigint handler and tested it