tweak ip handling logic more