fixed bug in case generate script