Added update and edit function