Patch 1

Another fix. This time to set the query properly