[main.js] fixed x and y bug