added if else to show page for nil values