completed edit function