move the IP detecting to server side.