fixed removing directory bug