added the latest working code with transactor