fix js registration bug