fixes for "array to string conversion" issue