Fixed addToLibrary