Added mails
fix a bunch of bugs