add email and file logging