fixed distinct (issue #19)