fix network logic