queryservice: improved strict mode check