fix a bug in vector lib