This is your threading bug
A race condition bug is a common class of bugs that occur when a sequence of actions assumes a state, but the state can be modified from an external source. We'll go in depth in many examples, but a quick example is a mobile app that assumes a data connection exists because you had previously performed an API call; the state of the network is controlled by an external source.