cleaned the path to the top dirctory