small chnage to main application to kill all threads when getting KeyboardInterrupt