waiting the load to execute js