fix bug with zero vector