Gets rid of unnecessary cd