fix the bug in javascript file