more robust, should work with anchor tags with child nodes now