check query