Fixing delete functionality.