Fixing issue with unhandled exception in random video function