fixed toggleTurn function