email logging fix