Added query handler