Changed QueryClass to BaseQuery