fixes order of script loading