corrected a bug with turn switching