change native for cross browser for loop