catch keyboard interrupt handler