Adds element existence check to avoid JS errors in welcome page.