Added length check
Added generic name check