correct sorting by score