fixed bug #2 and also isset shouldLoadJavascript method