fix closing of lists