Handle when element returned is null and also add logging for document.querySelector (non-zero return not tested)