Added an ip check function.