added ability to save new posts and edit existing