fixed wrong register in array boundary check