email func edited