Added some email-confirmation logic