remove invalid type cast