check ip and return -1