fixed error drastically slowing down vision code