Adding uid support in the queries