fixed #252 - setImmediate not available in browsers