Resolve for null pointer when F2 pressed