I have this code snippet. When I try to match a condition inside an `if` statement and if it's satisfied the `running` boolean value should be set to `false`. But it is (the `Thread`) still working. Can anyone please show me the error I'm doing?

```
    public void timer() {

        new Thread() {
            @Override
            public void run() {
                int min = 1;
                int sec = 10;
                System.out.println("--- " + min + " Minutes and " + sec + " Seconds ---");
                boolean running = true;
                while (running) {
                    System.gc();
                    try {                        
                        for (int i = sec; i <= 60; i--) {
                            if (i >= 0) {
                                System.out.println(min + " Minutes and " + i + " Seconds"); 
                                Thread.sleep(1000);
                            } else {
                                i = 60;
                                min--;
                                if (min < 0) { //condition I'm checking
                                    System.out.println("OOOOOOOOOOOOOKKKKKKKKKKKKKKKKKKKKKKKKK"); 
                                    running=false; //while loop should be false and thread should not run anymore
                                }
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        }.start();
    }

```

Everything is work fine. (**Even the "OKKKKKKKKK..." is printing too)**, but `running` is not setting to `false`.