fixing email-attach refactor