another minor error checking change