minor changes to edit logic