made email functional