Added support for distinct