a lot of bug fixes; email config