Check that input element exists before focusing