Handle empty dir problem