Another attempt to fix edit bug