implement sync_networks; add lots of exception checking