fix js errors when selecting pages in pages management