fixed js bug