added distinct query