changed condition for closing lingering divs. fixes #12