fixing bug that probablys has to do with the vectorization