change some codes from network package