fixed errors from checking details.js and main.js