modify add and delete function