fix edit and cancel