sourceDirectory is always not null so sourceDocumentName test should be before