fixed email bugs