Controller Mapping issue when loading client



So I have a sprint script that uses controller mapping to well, map the controllers.
When the script is loaded or reset during the run of the client it works fine but if you log in with it already running it throws an error due to the mapping.

[09/16 22:31:31] [DEBUG] [hifi.controllers] Creating new Mapping  "Hifi-FloofSprint-Mapping"
[09/16 22:31:31] [DEBUG] [hifi.controllers] Creating new Route builder proxy from  "536936452"
[09/16 22:31:31] [WARNING] [default] Unknown input:  "20010004"
[09/16 22:31:31] [DEBUG] [hifi.controllers] MappingBuilderProxy::from : source is null so no route created
[09/16 22:31:31] [CRITICAL] [hifi.scriptengine] [UncaughtException evaluate] Error: Result of expression 
'controllerMapping.from(Vive.LY)' [null] is not an object. in file:///d:/High Fidelity/FloofSprint.js:131
[09/16 22:31:31] [CRITICAL] [hifi.scriptengine] [Backtrace]
[09/16 22:31:31] [CRITICAL] [hifi.scriptengine]     <global>() at file:///d:/High Fidelity/FloofSprint.js:131

I think it might be due to the scriptengine loading too soon? but I have no idea in this regard.

Hopefully someone else might have a solution.