onReady runs process.exit(1) when err is truthy so I don't think both functions will get called?