if you have an error, connection is undefined.
Merge pull request #42 from Hiro-Nakamura/master

if you have an error, connection is undefined.