minor error checking