document must be ready