fix bug in transactions.