remove intermediate directory