js bug fix