adding functionality to the PagesController