fixes bad video memory leak