initJavascript to initScripts
Added modal support