fix js in subtrees