fixes bug in topology.py