Fixed issues with Sendgrid
merge master changes