fix ip generation to avoid duplicate