fixed vector out-of-bounds error