fix selecting of nulls