fixed removing directory bug from removing parent