Fix bug that can happen during reset race condition