not sure if you need the if, as long as m_ids is an arrary, as [].each will not do anything