Fix issue in ip range function