Added null check for profile name