handle duplicate ports