close div element correctly