race condition tweaks