fix case where we could end up with an empty <ul>