add validations for query