remove unnecessary setImmediate call