made things again less prone to race conditions