Fixed script ordering bug