only log when error occur