update and delete function completed