made menus not disappear and fixed code style