setImmediate inside a setTimeout