add cachevector and fix bug in cachematrix