fix js crash