fix some query malarkey