don't die if onRecord is undef