Added transaction function