close previous session before starting the new one