fix the setImmediate check for next execution context
minor code reformat
regenerate js file