video download fixed

video download fixed and some code cleanup