Added query form validation