fixing depth with text nodes