addded threading in email module