         delete functions[handle]
       handle
 
-  else
-    Batman.setImmediate = (f) -> setTimeout(f, 0)
-
-  if container.clearImmediate
-    Batman.clearImmediate = container.clearImmediate
-  else if container.msClearImmediate
-    Batman.clearImmediate = msClearImmediate
-  else if usingTasks
-    Batman.clearImmediate = (handle) -> tasks.unset(handle)
-  else if process?.nextTick
     Batman.clearImmediate = (handle) ->
       delete functions[handle]
-  else
+
+  else
+    Batman.setImmediate = (f) -> setTimeout(f, 0)
     Batman.clearImmediate = (handle) -> clearTimeout(handle)
+
+  Batman.setImmediate = Batman.setImmediate
+  Batman.clearImmediate = Batman.clearImmediate
 
 Batman.setImmediate = ->
   _implementImmediates(Batman.container)


  if container.setImmediate
    Batman.setImmediate = container.setImmediate
  else if container.msSetImmediate
    Batman.setImmediate = msSetImmediate
  else if canUsePostMessage()
    usingTasks = true

    prefix = 'com.batman.'
    functions = new Batman.SimpleHash
    handler = (e) ->

      tasks.set(handle = getHandle(), f)
      container.postMessage(prefix+handle, "*")
      handle
    Batman.clearImmediate = (handle) -> tasks.unset(handle)
  else if typeof document isnt 'undefined' && "onreadystatechange" in document.createElement("script")
    Batman.setImmediate = (f) ->
      handle = getHandle()
      script = document.createElement("script")
