Working on js bug