Added getClientIP function.