void checkExpiration(){
			for(Record rec:server.table.getTable() ){		
				for(Connection conn:server.connections){
					if(conn.username.compareTo(rec.getUsername())==0 && (System.currentTimeMillis()- rec.getTimeStamp() > 80000)){
						Message mes=new Message("server","TIMEOUT");
						mes.assureIntegrity();
						try {
							conn.cipherOut.writeObject(mes);
							conn.cipherOut.reset();
							conn.cipherOut.flush();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
						break;
						
						
						
//						try {
//							conn.cipherOut.writeObject(mes);
//							conn.cipherOut.reset();
//							conn.cipherOut.flush();
//							
//							System.out.println("Client "+conn.username+" key has expired. Creating new key for him");
//
//							DiffieHellman df=new DiffieHellman();
//							df.createNewKey(conn.username, false, conn.in, conn.out);
//							conn.cipherIn=df.getCipherIn();
//							conn.cipherOut=df.getCipherOut();
//							synchronized (server) {
//								server.table.updateRecord(df.getRecord());
//							}		    
//							//send a success message
//							mes.setMessage("Successfully Established a Secure Connection with server");
//							conn.cipherOut.writeObject(mes);
//							conn.cipherOut.reset();
//							conn.cipherOut.flush();
//							
//							System.out.println("Successfully Established a Secure Connection with client: "+conn.username);
//							
//						} catch (IOException e) {
//							e.printStackTrace();
//						}
//						break;
					}
				}
				
			}
		}