update the mechanism for determination of the element selector end