fix js nesting