fixed few bugs in email