added tokens limit check in height calculation