Fix javascript error changing permissions on pages in the sitemap