better handling of errors.