Fixing immediate email error, needs to be reconsidered