deletion logic