fix onExit error when not defined
Merge remote-tracking branch 'origin/master'