changed query handling