fix a race condition (the dirty way)