Updated the code to hide menu options

I have changed the code to hide menu options while clicking anywhere else on screen.