fix createQuery methods