range comparing fix