resolved the edit() bug