fix type cast error where select tid