updated and added email functions