added a cleanup function to VideoCapture that will hopefully prevent startup errors