Update generator.py

Making sure to have the proper request when working with class instances in sitemaps. In other case, vars in session behave erratic.