adding null check to getLibraries call