added ts range check