handle Keyboardinterrupt correctly

close #34