with edit function