small fix in handling not found documents