mailgun complete, some changed logic