fixing edit bug