fix js generated code