move #content_wrapper closing dif into the correct logic block