Fixed race condition on async behavior