handling different name formats