fix in creating new posts and updating existing ones