improve user edit function