fixed getQuery operation