fixed vector out of bound error