Fixed a broken query