fix to js bug