fix Array to string conversion error in php 5.4