redo add and upate functions