fixed  generate_ports.sh