Fix bugs in states.js and set basic data.js