private synchronized void stop(){
        if(!running){
            return;
        }

        running = false;
        try {
            thread.join();
        }
        catch (InterruptedException e) {
	    e.printStackTrace();
        }
        try {
            System.exit(0);
        }
        catch (Exception e) {
	   // e.printStackTrace();
        }
    }