adding email functionality