Implemented TransactionMiddleware