fix immediate error when handling history lookups on deleted documents. There can still be issues because we are attempting to break the original design assumptions