Fixed array to string conversion error