Fix undefined IP bug