The updating of sessions-left was in the wrong branch and was not reached until the value reached 0