fix incorrect subscripting