Fix connection closing on switch IDLE state