fix dir removing issue