avoid calling max on an array with nils