Fixed addScripts method