better reporting and error checking