         apply(__MODULE__, action, [conn, defn, params])
       end
 
+      defp handle_before_filter(%{halted: true} = conn, _, _, _), do: conn
       defp handle_before_filter(conn, action, defn, params) do
         _handle_before_filter(conn, action, defn, params, defn.controller_filters[:before_filter])
       end

        assign(conn, :resource, resource)
      end

      defp handle_custom_actions({conn, params}, action, defn, _) do
        handle_custom_actions(conn, action, defn, params)
      end

      end
      defp _handle_after_filter(args, _action, _defn, _), do: args

      defp handle_plugs(%{halted: true} = conn, _, _), do: conn
      defp handle_plugs(conn, :nested, _defn), do: conn
      defp handle_plugs(conn, _action, defn) do
        case Application.get_env(:ex_admin, :plug, []) do
