added exception handling for staticlibs