fixed check query