Fix a bug when finish will report failed