one more bug fix + moved the js loading from onload to init