wrapped main-menu toggle function in self executing function