swapped the state changes in the startup listen h