applied layout to the pages