     end
 
     update_stack(module, fn [scope|stack] ->
-      scope = put_elem(scope, 3, elem(scope, 3) ++ pipes)
+      scope = put_in scope.pipes, scope.pipes ++ pipes
       [scope|stack]
     end)
   end

    alias = Keyword.get(opts, :alias)
    if alias, do: alias = Atom.to_string(alias)

    as = Keyword.get(opts, :as)
    scope = {path, alias, as, []}
    update_stack(module, fn stack -> [scope|stack] end)
  end


  @doc """
  Returns true if modules definition is currently within a scope block
  """
  def within_scope?(module), do: get_stack(module) != [%Scope{}]

  defp join(module, path, alias, as) do
    stack = get_stack(module)
