fix endless loop in totalscore calculation