fixed bug when editing item