Changed map to dynamic array