fixed bug in ip range check and add cidr range checking