public synchronized void synchronizeHabitat(int id) {
		try {
			
			if (existsHabitat(id)) {
				byte[] array = getHabitat(id).toByteArray();
				
				PreparedStatement sync = db.prepareStatement("UPDATE " + CuboidHandler.habitatTable + " SET habitat = ? WHERE cuboidid = '" + id + "';");
				Blob blob = new SerialBlob(array);
				
				sync.setBlob(1, blob);
				sync.executeUpdate();
				
				Habitat synced = Habitat.toHabitat(getHabitat(id).toByteArray());
				getHabitats().put(id, synced);
				
				return;
			}
			
			List<Map<String, Object>> results = db.getResults("SELECT * FROM " + CuboidHandler.habitatTable + " WHERE cuboidid = '" + id + "';");
			
			if (results.isEmpty()) {
				EdgeCuboid.log.info(EdgeCuboid.cuboidbanner + "No Synchronizable Habitat Entries Found! Cancelling synchronization..");
				return;
			}
			
			byte[] byteToHabitat = (byte[]) results.get(0).get("habitat");
			
			Habitat habitat = Habitat.toHabitat(byteToHabitat);			
			getHabitats().put(habitat.getCuboidID(), habitat);
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	}