Added the Menu Button code and removed more unnecessary code form input handler