Fixing plugin error handling issue