bug fix in PYNetwork