Check for document existence