minor change : ignoring the duplicate rows from the main db query
updated to support input library names with spaces as long as the input
is quoted