fixed generator bug