fixed some vision code problems