update add and delete functionality