Runtime error on determineNextPlayer fixed