fixes tree filter function issue