removed some unncessary code from pages controller