added edit and add functionality to pages