update js check logic