fix bug with null vector.