updated distinct api