choosing open tcp port when sending avatar, some bug fixes