Fix issue where all pages were loaded though ajax.