     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]

  # @note `guard` must be a string, where string is a method from `controller` or function
  # @note you might create in controller method with name: `before_x`, where `x` you action, then you may not specify `before` into params, it automatically find and assigned as `before` method, the same for `after` and `guard`
  # @note `data` must be a string, or array of string
  constructor: (params) ->
    controller = params['controller'] || throw new Error("Params must contain a Controller")


    act = params['action']

    @action = if Sirius.Utils.is_string(act)
                controller[act]
              else if Sirius.Utils.is_function(act)
                act
              else
                throw new Error("Action must be string or function");

    if !Sirius.Utils.is_function(@action) && !Sirius.Utils.is_string(@action)
      throw new Error("Action must be string or function")

    @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
