You're right. Now use concat. And to_a to for a case when map_bins is nil.