[js] no more race condition