fixed problem with vectors in functions