Added conditionals to Page generation