corrected keypress handling