the try catch did not work. use size of vectors instead.