fix max score (was only looking for current score instead of the document's score)