fix error when nothing directory