fix a crash when fail