fix js code