solved map arrays with undefined elements bug