Close divs properly