fixing nameclashes between directories and documents