fixing video mode switching