error checking script