modified core javascript