fixed typecasting