moved update function into pagecreate