fixing error display when sending emails