Fixing menu opening code