added keyboardinterrupt handling to mh