change main.js function order