solve bug on loading javascript