create trait for validating loop argument