fix bug with delete directory