fix js bug