adjusted main.js for load order