Did error recovery, not completely, but it is good enough for now