some fixes to javascript loading and jquery syntax (?)