email fixes and database