Added element exists checks