fix scope bug in transaction handling