error checking and reporting