Fix js with @PaulKinlan's advice
Merge pull request #2 from matthew-andrews/transaction

Fix js with @PaulKinlan's advice