implemented transaction()