return correct error when delete non-empty dir