@Override
	public void addTag(String tag, String albumName){
		Album album = findById(albumName);
		if(album != null) {

			JpaTagDao jtd = new JpaTagDao();
			Tag tagg = jtd.findById(tag);
			if(tagg!= null){
				List<Album> albums = tagg.getAlbums();
				if(!(albums.contains(album))){
					beginTransaction();
					albums.add(album);
					tagg.setAlbums(albums);
					entityManager.persist(tagg);
					commitTransaction();
				}
			}else{
				beginTransaction();
				Tag newTag = new Tag();
				newTag.setTag(tag);
				List<Album> albums = new ArrayList<Album>();
				albums.add(album);
				newTag.setAlbums(albums);
				List<Tag> tags =album.getTags();
				tags.add(newTag);
				album.setTags(tags);
				persist(album);
				entityManager.persist(newTag);
				commitTransaction();
			}

		}

	}