Changed keyboardInterruptHandler function