handle errors from registry better