Fixed error in range