move js from layout to main.js