move local emails out of if statement