removed duplicate code in script.js