updated script loading functions