replaced .find() with pure js