Fixed the 'array to string' error (hopefully)