fix js errors