fixed the edit bug