syntax error in generator