fixed bugs with svd