fix bug in function getFactionScores