You cannot move this, we moved this before changing the state because there is a race between the two that causes a panic.

The real fix for this is that we don't have the same information in two places ( wait lock and State ), until then there will always be a race between the two