check mainPid
Merge remote-tracking branch 'origin/master' into 0.5.1