added length check for too few fields