cleaning cd function
handle extra case when interpreter was not detected. update #2373