added global to setImmediate