added if statement to get email