fixing document model