Fix for multiple documents in the same directory