menu works correctly for one page. code is a hack