fixed bug in edit