Revert "fix ip detect function (again)"

This reverts commit 03f240b08eb4573e972c9d4a3ec669f6aa8a82db.
Revert "update function to get ip address"

This reverts commit f299a1e01f63f10b9b802c34c75d479fb5bdde06.