update core.js ,fix end bug