generator bug fix