editing pages controller to updated version