Use setImmediate instead of setTimeout with 1 millisecond param