I should have replaced all this with the single reference to the requirejs script