fixed: finding element to autofocus

added check if element has children, before trying to traverse through
them