fix type cast