commit by jayli
Merge pull request #3 from jayli/master

bugfix for undefined var