Fix function working with network