fixed a typecasting