public boolean writeMsg (String sender,String message)   {
		
    	DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
		Calendar cal = Calendar.getInstance();
    	String date = " Sent on-" + dateFormat.format(cal.getTime());
		String text = message;
		String Msg = sender + ": " + text + date;	
		BufferedWriter writer = null;
		boolean status = false;
	    try {
	    	FileWriter fr = new FileWriter("./ChatHistory.txt",true);
	    	writer = new BufferedWriter(fr);
	    	writer.append(Msg);
	    	writer.append("<br>");
	    	writer.newLine();
	    	status = true;
	    } 
		catch (IOException e) {
	        System.err.println(e);
	        status = false;
	    } finally 
		{
	        if (writer != null) {
	            try {
	                writer.close();
	            } catch (IOException e) {
	                System.err.println(e);
	            }
	        }
		}
		return status;
	
		
    }