fixed a bug in the add function of sparse vector