Add try catch when element does not exist in the DOM.