Fixed initial race condition on startup