generator fixed bug