fix port reconnection