added join network function