added error handling if plugin didnt work correctly