cleaned up plugin error message code