Fixed the Array to string conversion php error