working on edit function