Fixed Cannot call method "error" of undefined error
Merge pull request #15 from jnik/master

Fixed Cannot call method "error" of undefined error