fixing some bugs on the email feature.