fixed ldh and dh for directories with spaces