Fixing edit bug