Fix bug in javascript file