try to fix edit function, which no longer works