Repleced deprecated process.nextTick with setImmidiate