fixed type error in line 308