fixes reader race conditions