fix bug in topology assignment