Fixing exception when controller is not an array (for exemple, a Closure)