fixed type errors.