improve empty list handling