handle interruption gracefully