changed db and email sending