prevent array to string conversion error in template