change native map for loop, more performant and cross browser