fix #1
fix #2 (html only)
fix #2 (js)
fix #4
fix #3