sgen bug fix