Fix for state race condition.