check if document is present before removal