update and create post functions