small error checking