Added a few function in main.js