fixes error in pages controller