added check if library was loaded