fixed type casting error