fix ip resolution function

should resolve issue #2