bug fix on network construction