gen class bug fix