Moving a closing div at the right place