edit function in public top