render the pages properly