added email functionality
merged changes