Changed a couple of things

Moved the email query into the Create email function.