fixed logic for names and addresses