fix js when changing menu items in pages