patched up ValueError in net.py