"Failed to build request request_16: No attribute named 'example' 1 (100.0%) is defined" error message, when using check(regex("exampleregex").saveAs("examplevalue") and using the examplevalue on a later phase.

Hi, please help to find the problem. Here is the code snippet:

.exec(http(“request_0”)
.get("/home")
.headers(headers_0)
.resources(http(“request_1”)
.get("/example.js")
.check(regex(""“exampleregex”"").saveAs(“examplevalue”))
.headers(headers_1),

http(“request_16”)
.get(uri5 + “/exampleurlpart”+"${examplevalue}"+“exampleurlpart”)

I managed to figure out, that the problem was, that my requests are both under resources, and maybe the check runs after i want to use the value from it. (I get "Failed to build request request_16: No attribute named examplevalue is defined). Can I set the order of the resources or something like that?