Fix bug when div is nested