bring in line with some latest changes
temporary fix for PHP Fatal error with WP_Error