Fix ip check