fix issue when throw error of 'because the file is not valid xxx'