fixed bug during edit/delete