modify ipaddr check more strictly