added email functionality