adding error log to email module