delete functionality and data persistence