amended to `check_token_validity()` with ac7a1dec03896797384c349a35d916bcbf153ed1