added condition to make sure an input was available for videos