fixing document references