Fixed bug of string casting and tenant id