fixed currentPlayer function