fix when error exit