Added DISTINCT clause to the right location.