Added getLocalAddress function