Another change to error checking