Declare 'library' variable

Fixed error caused by reference to the "library" variable that had not
been declared