add process.on protection