     redirect_to_hash   = setting["old"]
     push_state_support = setting["support"]
 
+    # context should be null for functions without controller
+    wrapper = (fn) ->
+      #console.log Sirius.Application.controller_wrapper
+      for key, value of Sirius.Application.controller_wrapper
+        @[key] = value
+
+      fn
+
+
     # set routing by event
     for url, action of routes when @_event_route(url)
       handler = if Sirius.Utils.is_function(action)
-        action
+        wrapper(action)
       else
-        (e) -> (new Sirius.ControlFlow(action)).handle_event(e)
+        (e) -> (new Sirius.ControlFlow(action, wrapper)).handle_event(e)
 
       z = url.match(/^([a-zA-Z:]+)(\s+)?(.*)?/)
       event_name = z[1]

    # for cache change obj[k, v] to array [[k,v]]
    array_of_routes = for url, action of routes when @_hash_route(url)
      url    = new Sirius.RoutePart(url)
      action = if Sirius.Utils.is_function(action) then action else new Sirius.ControlFlow(action)
      [url, action]

    plain_routes = for url, action of routes when @_plain_route(url)
      url    = new Sirius.RoutePart(url)
      action = if Sirius.Utils.is_function(action) then action else new Sirius.ControlFlow(action)
      [url, action]

    dispatcher = (e) ->

    @logger  = options["logger"]  || @logger
    @start   = options["start"]   || @start

    for key, value of (options["controller_wrapper"] || {})
      @controller_wrapper[key] = value

    @hash_always_on_top = options["hash_always_on_top"] || @hash_always_on_top
    @use_hash_routing_for_old_browsers = options["use_hash_routing_for_old_browsers"] || @use_hash_routing_for_old_browsers
