Fixed type cast issue