fix bug with detecting a changed ip, thanks to TNe-TWo