issues with typecasting