fix bug of keyboard interrupt handler.