refined logic for handling error deleting a transaction item