Fixed bug when starting a new session.