fix error of sorting & editing