Adjusted the field length validation logic