added support for DISTINCT columns