JS tree issue solved