fix previousSibling bugs