added error checking register