handle nils in ranges