I am using a highly modified version of the jqueryFileTree plugin, that is able to add new files and folders. When a new file is created in realtime I have to bind the tree again to the click event so that all new files and folders can work as intended.

Just re-binding the filetree has caused me some trouble with the functionality of folders. For every new file the filetree runs bind which means that when you add one file and then click on a directory to close it, it opens and then closes because the function is run two times.

I localized the problem recently and am trying to unbind all events connected to the filetree before rebinding. However, the problem still occurs. Why could this be? Syntax error?

```
$('UL.jqueryFileTree').unbind();
bindTree('UL.jqueryFileTree');

```

Cheers!

Chris