fixed bug in gm generator