Fixed diff query check