Bug fix in transaction