moved this so that other resources are properly initialized before loading scripts