changed the api for applydiff to apply diffs on not only the body element