lots of broken code relating to pages model and updating pages model