before map javascript change