fix stupid race condition