proper way to determine ip