complete add and edit feature