debug in main.js : everything malfunction fixed