improve scope initialization of local script