load external libraries only once, fixes #1662