Changed check for HUD when keyboard is dismissed. Fixes #244