added some kind of error-detection