fixed session.py bug