transaction.js improved