rm base dir logic