Fix check query method bug