Fix JS exception