fix library id extraction