Rather than fixing the if, else blocks after the failure happens, might be better to "return false" at the detection of the failure.