to finish the function of editing a post