add code to core.js