updated add and delete functionality