fix bug in calculate score