fixes #9
fixes #11
fix the sample function for sending email
fixes #1