revise edit function in UI