add null checks to list/arrays