bug fix on js