made port assignment dynamic