Fixed bugs with emails