Fix bug when editing post