bug fix in generator