public boolean createDirToLocal(String parentPath, String dirName) {
		try {
			String dirPath;
			if (parentPath.length() == user.getUsername().length() + 1) { // username\
				dirPath = parentPath + dirName;
			} else { // username\***
				dirPath = parentPath + "\\" + dirName;
			}			
			//System.out.println(dirPath);

			// create on local machine
			File newDir = new File(dirPath);
			if (!newDir.exists()) {
				newDir.mkdirs();	
			} else {
				System.out.println("The directory exits in local, " + dirPath);
			}
			
			// record in user's account
			Map<String, Map<SafeFile, Vector<SafeFile>>> m = user.getFileMap();
			SafeFile newSafeDir = new SafeFile(1, dirPath, user.getUsername());
			if (!m.containsKey(newSafeDir)) {
				// make sure to create each directory in parentPath in user's account
				if(parentPath.length() != user.getUsername().length() + 1) {
					checkPath(parentPath); // check parent path
					SafeFile parentSafeDir = new SafeFile(1, parentPath, user.getUsername());
					// add the friend info
					Set<SafeFile> files = m.get(user.getUsername()).keySet();
					for (SafeFile sf : files) {
						if (sf.equals(parentSafeDir) && !sf.getFriendList().isEmpty()) {
							newSafeDir.setFriendList(sf.getFriendList());
							break;
						}
					}
					
					if (m.get(user.getUsername()).get(parentSafeDir).add(newSafeDir)) { // add new file to parent
						//System.out.println("New directory added in parent's list, " + dirPath);
					}
				}				
				// add the directory to the map
				m.get(user.getUsername()).put(newSafeDir, new Vector<SafeFile>()); 
				
				//System.out.println("New directory created in local successfully, " + newSafeDir.getFilePath());
				return true;
			} else {
				System.out.println("Directory exists in user's account, " + newSafeDir.getFilePath());
				return true;
			}
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}