Fix recurive script issue