fixing new and edit pages