Last fix for getip function. Finally :)