changed script.js to fix pop state