fixed type error bug