fix modules dir detection