added debug prints in KeyPressHandler