added error assignment on while writing to network
Merge pull request #18 from mgurevin/master

bug: error assignment on while writing to network