resolving problems made by modification for sending email