Fixed bug when passing ip address using wrong variable