Saner query handling