implemented selector api on the document