catch any errors during plugin loading