add keyboardinterrupt support