Fixed script load order issue