handle interrupts gracefully