fixed loading of scripts