fix null pointer issue with key presses