Add logic to display of pages