add check() method to query