added support for shared libraries