upd port_changed to work properly