Fix failure is not correctly returned issue