Changed some JS code