Changed validip function