fix error with undefined callback
Merge pull request #1140 from mathisonian/patch-1

fix error with undefined callback