Fixes nextSibling of null error