Fixed duplicate problem using distinct()