Improve js file and fix some bug