fixed javascript tree errro