try to fix edit function