checking failure codes