fixing some bugs in emails