Update gitignore
Fix event handler
Rewrite build tree method