BugFix for "cannot read previous sibling" error