class generation bug fix