fix bug with js loading