Added query check and query input display