fix directory operations