don't die if onRecord is undef
Merge pull request #4 from nichtich/master

don't die if onRecord is undef