Fix bug in PagesController