Fixing DOcument wrapper issue