check query_failure flag