Invisible menu

Solved the bug where the menu was sometimes invisible when opening and
closing it fast.