fixed a bug in get distinct value method