Added exception handling for plugin loading