fixed script loading bug