Added an extra check to see wether YT API has been initialized. The current check is inadequate as YT can be an object while the API still isn't completely initialized.