fix rfoldr for vector