updated invalid name formatting and fixed bug due to array intersect sequence.