Improvement of the rec function and fix youtube object bug