When calling this 2 procs mentioned, it tries to set a namespace variable with a ::html::set instead of ::set. However, even replacing "set" by "::set" on those 2 procs, it overrides the last value.
What i did was just to replace "set page(js)" by "lappend page(js)". same for css, as ::html::head calls those vars with a "foreach", meaning that they should be lists. Now it works fine.