fix log printing crash bug in final exception