check is_array before implode