Added extra checks for the profile to make sure it is filled in.