fixed playerTurn function