Moving the js loading upfront to make popover effective