Added try catch to plugin handled function