Updated delete functionality.