completed dynamically defined validation logic and test