front js code
Resolve conflicts from master merge
fix some bugs