Updated the save functions in the post controller