first func to main.js