Fix array to string conversion exception