Finally fix that pesky bug with query