fix some small bugs
add some js tricks