change the error code checking