set up sendgrid service
debug control flow fix, and send email fix