correct error in keyhandling