changed base dir detection