Re #922 Changing the queries to one query.