fix bug in pages controller