initialize the vectors only once and resize if needed