error checking code updae