added a function to 'add' and 'delete' to communicate through the sockets