added search materials function for user and librarian