added the get_gateway() function