wrap creation in a transaction