when in mobile mode it waits till menu closes then changes the page