public void update(Observable obs, Object o) {
		if(o instanceof String){
			prepareNextTextMessage(((String)o));//looks weird 
				ack_buffer.addAll(members.subList(0, members.size()));//add expected acknowledgements from all the users of members.
				timer.start();
			sender.wakeUp();
		}
		if(o instanceof WindowEvent){
			prepareDisconnectPacket();
			sender.wakeUp();
			try {
				synchronized(this){
				wait(1);
				System.exit(1);
				}
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			
		}
		if(o instanceof Boolean){
			if(!((Boolean)o)){
				System.out.println("Leaving group...");
				prepareDisconnectPacket();
				sender.wakeUp();
				try {
					sender.getSocket().leaveGroup(sender.getGroup());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			
			if(((Boolean)o)){
				try {
					last_seq_num=-1;
					System.out.println("Joining group...");
					sender.getSocket().joinGroup(sender.getGroup());
					
				} catch (IOException e) {
					System.out.println("Could not connect ");
					e.printStackTrace();
				}
			}
		
		}
	}