added MainMenu changes from original master