fix bug when selects contain nils