fixed email bug, minor fixes