Some code was in the wrong javascript file