Updated the save post function to work with updating a post