added queryStatus and validation for query Inputs