corrected the distinct filter bug for the postgresql