Added threading for scripts
Fixed ScriptProvider reference