Fixed a typo in the run query function