fixing up distinct problem