Fixed issue with opening and closing menu and updated menu handling