dieout() function already takes into account if a </ul> is needed.